package com.wc.alorithm_blue_bridge._前缀和与差分.Q3693;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.StreamTokenizer;

/**
 * @Author congge
 * @Date 2023/11/8 17:56
 * @description 肖恩的投球游戏
 * https://www.lanqiao.cn/problems/3693/learning/?page=1&first_category_id=1&sort=students_count&tags=%E5%B7%AE%E5%88%86
 */
public class Main {
    public static void main(String[] args) {
        Input sc = new Input();
        int n = sc.nextInt();
        int m = sc.nextInt();
        int[] a = new int[n + 1];
        int[] b = new int[n + 2];
        for (int i = 1; i <= n; i++) {
            a[i] = sc.nextInt();
            b[i] = a[i] - a[i - 1];
        }
        while (m-- > 0) {
            int l = sc.nextInt();
            int r = sc.nextInt();
            int c = sc.nextInt();
            b[l] += c;
            b[r + 1] += -c;
        }
        for (int i = 1; i <= n; i++) {
            a[i] = a[i - 1] + b[i];
        }
        StringBuffer ans = new StringBuffer();
        ans.append(a[1]);
        for (int i = 2; i <= n; i++) {
            ans.append(' ');
            ans.append(a[i]);
        }
        System.out.println(ans);
    }

    static class Input {
        StreamTokenizer in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));

        public int nextInt() {
            try {
                in.nextToken();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return (int) in.nval;
        }
    }
}
